package com.atguigu.day17.work2;

import java.util.Scanner;

public class Work03 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("输入大字符串:");
        String big=input.nextLine();
        System.out.println("输入小字符串:");
        String small=input.nextLine();

        int index;
        int count=0;
        while ((index=big.indexOf(small))!=-1){
            big=big.substring(index+small.length());
            count++;
        }
        System.out.println(small+"出现"+count+"次");
        input.close();
    }
}
